package org.example.study2;

import java.io.FileWriter;
import java.io.IOException;

public class FileWriterExample1 {
    public static void main(String[] args) throws IOException {
        try (FileWriter fileWriter = new FileWriter("d:/temp/input.txt")) {
            fileWriter.write("hello world");
            fileWriter.write('\n');
            fileWriter.write("你好世界");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
